package jsyf.oa.entity.doc;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.List;

/**
 * Created by Administrator on 2018/4/20.
 */
@Entity
@Table(name = "T_DOC_MAIN", schema = "oa", catalog = "")
public class MainEntity extends BaseEntity implements Serializable {

    private String fkTypeId;
    private String docName;
    private String source;
    private String attachName;
    private String attachUrl;
    private String imageName;
    private String imageUrl;
    private String companyId;
    private String departName;
    private String createUserId;
    private Integer screenType;


    public String getFkTypeId() {
        return fkTypeId;
    }

    public void setFkTypeId(String fkTypeId) {
        this.fkTypeId = fkTypeId;
    }

    public String getDocName() {
        return docName;
    }

    public void setDocName(String docName) {
        this.docName = docName;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getAttachName() {
        return attachName;
    }

    public void setAttachName(String attachName) {
        this.attachName = attachName;
    }

    public String getAttachUrl() {
        return attachUrl;
    }

    public void setAttachUrl(String attachUrl) {
        this.attachUrl = attachUrl;
    }

    public String getImageName() {
        return imageName;
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getDepartName() {
        return departName;
    }

    public void setDepartName(String departName) {
        this.departName = departName;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public Integer getScreenType() {
        return screenType;
    }

    public void setScreenType(Integer screenType) {
        this.screenType = screenType;
    }


    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("FK_TYPE_ID", getFkTypeId());
        obj.put("DOC_NAME", getDocName());
        obj.put("SOURCE", getSource());
        obj.put("DEL_FLAG", getDelFlag());
        obj.put("ATTACH_NAME", getAttachName());
        obj.put("ATTACH_URL", getAttachUrl());
        obj.put("IMAGE_NAME", getImageName());
        obj.put("IMAGE_URL", getImageUrl());
        obj.put("COMPANY_ID", getCompanyId());
        obj.put("DEPART_NAME", getDepartName());
        obj.put("CREATE_USER_ID", getCreateUserId());
        obj.put("CREATE_TIME", getCreateTime());
        obj.put("SCREEN_TYPE", getScreenType());
        return obj;
    }

    @Override
    public String getTableName() {
        return "t_doc_main";
    }

    @Override
    public String getViewName() {
        return "v_doc_main";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("FK_TYPE_ID", "fkTypeId");
        obj.put("DOC_NAME", "docName");
        obj.put("SOURCE", "source");
        obj.put("DEL_FLAG", "delFlag");
        obj.put("ATTACH_NAME", "attachName");
        obj.put("ATTACH_URL", "attachUrl");
        obj.put("IMAGE_NAME", "imageName");
        obj.put("IMAGE_URL", "imageUrl");
        obj.put("COMPANY_ID", "companyId");
        obj.put("DEPART_NAME", "departName");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("CREATE_TIME", "createTime");
        obj.put("SCREEN_TYPE", "screenType");
        return obj;
    }
}